Public Class NCargos
    Public Function cargarCargo(ByVal cargo As Entidades.ECargo) As Boolean
        'utiliza la capa de datos
        Dim oDatos As New Datos.DCargos
        Dim band As Boolean
        Try
            band = oDatos.cargarCargos(cargo)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    Public Function modificarCargo(ByVal cargo As Entidades.ECargo) As Boolean
        'utiliza la capa de datos
        Dim oDatos As New Datos.DCargos
        Dim band As Boolean
        Try
            band = oDatos.modificarCargo(cargo)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
        Return band
    End Function

    'SOBRECARGADO
    Public Function buscarCargos(ByVal cargo As String) As List(Of Entidades.ECargo)
        'utiliza la capa de datos
        Dim oDatos As New Datos.DCargos
        Try
            Return oDatos.buscarCargos(cargo)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    'SOBRECARGADO
    Public Function buscarCargos() As List(Of Entidades.ECargo)
        'utiliza la capa de datos
        Dim oDatos As New Datos.DCargos
        Try
            Return oDatos.buscarCargos()
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function buscarCargoPorLegajo(ByVal codigo As Integer) As Entidades.ECargo
        'utiliza la capa de datos
        Dim oDatos As New Datos.DCargos
        Try
            Return oDatos.buscarCargoPorLegajo(codigo)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function traerCodigoCargo(ByVal cargo As Entidades.ECargo) As Integer
        'utiliza la capa de datos
        Dim oDatos As New Datos.DCargos
        Try
            Return oDatos.traerCodigoCargo(cargo)
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        Finally
            oDatos = Nothing
        End Try
    End Function

    Public Function generarProximoCodigo() As Integer
        Dim oDatos As New Datos.DCargos
        Dim codigo As Integer
        Try
            codigo = oDatos.traerProximoCodigo()
        Catch ex As Exception
            Throw New ArgumentException(ex.Message)
        End Try
        Return codigo
    End Function
End Class